package ui.panels;

import entities.Shift;
import entities.ShiftRequest;
import java.awt.Color;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import manager.GenericDriver;
import model.ViewShiftComboBoxModel;
import ui.windows.RemedySchedulerFrame;

public class GenerateShiftRequestPanel extends javax.swing.JPanel {

    /** Creates new form GenerateShiftRequestPanel */
    public GenerateShiftRequestPanel(RemedySchedulerFrame mainFrame, EditShiftRequestPanel parentPanel) {
        initComponents();
        this.mainFrame = mainFrame;
        this.parentPanel = parentPanel;
        includeModel();
    }

    private void includeModel() {
        GenericDriver genDriver = mainFrame.getGenericDriver();
        model = new ViewShiftComboBoxModel(genDriver.showShift());
        cbShifts.setModel(model);

        new Thread() {

            @Override
            public void run() {
                while (true) {
                    createDate = Calendar.getInstance().getTime();
                    SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd h:mm a");
                    lbCreateDate.setText(format.format(createDate));
                    try {
                        sleep(1000);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(GenerateShiftRequestPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }
        }.start();
        choiseDay = true;
        check1 = false;
        check2 = false;
        check3 = false;
        check4 = false;
        valid = false;
    }

    private void createRequest() {
        finalCheck();
        if (valid) {
            ShiftRequest request = new ShiftRequest();
            request.setCreateDate(createDate);
            if (choiseDay) {
                request.setStartDate(getOnlyDate(dCDay.getDate()));
                request.setEndDate(getOnlyDate(dCDay.getDate()));
            } else {
                request.setStartDate(dCWeek.getDate());
                request.setEndDate(new Date(getOnlyDate(dCWeek.getDate()).getTime() + 7 * 24 * 60 * 60 * 1000));
            }
            request.setShiftId(cbShifts.getSelectedIndex() + 1);
            request.setReason(txaReason.getText());
            request.setStatus(1);
            boolean returnVal = parentPanel.createShiftRequest(request);
            if (returnVal) {
                close();
                JOptionPane.showMessageDialog(null, "Created !");
            } else {
                JOptionPane.showMessageDialog(null, "Cannot insert !", "Error", JOptionPane.WARNING_MESSAGE);
            }
        }
    }

    private void switchRequest() {
        if (rbDay.isSelected()) {
            dCWeek.setDate(null);
            choiseDay = true;
            dCDay.setEnabled(true);
            dCWeek.setEnabled(false);
            lbSelectDay.setForeground(Color.black);
            lbSelectWeek.setForeground(new Color(102, 102, 102));
            lbMess1.setForeground(Color.black);
            lbMess2.setForeground(new Color(102, 102, 102));
            lbCheckDate2.setText("");
        } else {
            dCDay.setDate(null);
            choiseDay = false;
            dCDay.setEnabled(false);
            dCWeek.setEnabled(true);
            lbSelectDay.setForeground(new Color(102, 102, 102));
            lbSelectWeek.setForeground(Color.black);
            lbMess1.setForeground(new Color(102, 102, 102));
            lbMess2.setForeground(Color.black);
            lbCheckDate1.setText("");
        }
    }

    private void checkDate1() {
        if (choiseDay) {
            Date requestDate = getOnlyDate(dCDay.getDate());
            if (requestDate != null) {
                Date validDate = new Date(getOnlyDate(createDate).getTime() + 1 * 24 * 60 * 60 * 1000);
                if (!validDate.after(requestDate)) {
                    lbCheckDate1.setText("valid");
                    lbCheckDate1.setForeground(new Color(102, 102, 102));
                    check1 = true;
                } else {
                    lbCheckDate1.setText("invalid !");
                    lbCheckDate1.setForeground(Color.red);
                    check1 = false;
                }
            } else {
                lbCheckDate1.setText("enter !");
                lbCheckDate1.setForeground(Color.blue);
                check1 = false;
            }
        }
    }

    private void checkDate2() {
        if (!choiseDay) {
            Date requestDate = getOnlyDate(dCWeek.getDate());
            if (requestDate != null) {
                Date validDate = new Date(getOnlyDate(createDate).getTime() + 7 * 24 * 60 * 60 * 1000);
                if (!validDate.after(requestDate)) {
                    lbCheckDate2.setText("valid");
                    lbCheckDate2.setForeground(new Color(102, 102, 102));
                    check2 = true;
                } else {
                    lbCheckDate2.setText("invalid !");
                    lbCheckDate2.setForeground(Color.red);
                    check2 = false;
                }
            } else {
                lbCheckDate2.setText("enter !");
                lbCheckDate2.setForeground(Color.blue);
                check2 = false;
            }
        }
    }

    private void checkShift() {
        Shift choise = (Shift) cbShifts.getSelectedItem();
        if (choise != null) {
            lbCheckShift.setText("");
            check3 = true;
        } else {
            lbCheckShift.setText("enter !");
            lbCheckShift.setForeground(Color.blue);
            check3 = false;
        }
    }

    private void checkReason() {
        String reason = txaReason.getText();
        if (reason != null && reason.length() != 0) {
            lbCheckReason.setText("");
            check4 = true;
        } else {
            lbCheckReason.setText("enter !");
            lbCheckReason.setForeground(Color.blue);
            check4 = false;
        }
    }

    private void clear() {
        rbDay.setSelected(true);
        switchRequest();
        cbShifts.setSelectedItem(null);
        dCDay.setDate(null);
        dCWeek.setDate(null);
        lbCheckDate1.setText("");
        lbCheckDate2.setText("");
        lbCheckShift.setText("");
        lbCheckReason.setText("");
        txaReason.setText("");
        createDate = null;
        lbCreateDate.setText("");
        choiseDay = true;
        check1 = false;
        check2 = false;
        check3 = false;
        check4 = false;
        valid = false;
    }

    private void finalCheck() {
        if (!valid) {
            checkDate1();
            checkDate2();
            checkShift();
            checkReason();
            if ((check1 || check2) && check3 && check4) {
                valid = true;
            } else {
                valid = false;
            }
        }
    }

    private void checkAction() {
        finalCheck();
        if (valid) {
            lbValid.setText("valid");
            lbValid.setForeground(new Color(102, 102, 102));
        } else {
            lbValid.setText("invalid !");
            lbValid.setForeground(Color.red);
        }
    }
    
    private Date getOnlyDate(Date date) {
        if(date != null) {
            return new Date(date.getYear(), date.getMonth(), date.getDate());
        }
        return null;
    }

    private void close() {
        clear();
        parentPanel.closeTarget();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        lbClose = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        lbCreateDate = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        rbDay = new javax.swing.JRadioButton();
        rbWeek = new javax.swing.JRadioButton();
        lbSelectDay = new javax.swing.JLabel();
        lbSelectWeek = new javax.swing.JLabel();
        dCDay = new com.toedter.calendar.JDateChooser();
        dCWeek = new com.toedter.calendar.JDateChooser();
        lbMess1 = new javax.swing.JLabel();
        lbMess2 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        cbShifts = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        txaReason = new javax.swing.JTextArea();
        lbCheckShift = new javax.swing.JLabel();
        lbCheckDate1 = new javax.swing.JLabel();
        lbCheckDate2 = new javax.swing.JLabel();
        lbCheck = new javax.swing.JLabel();
        lbValid = new javax.swing.JLabel();
        lbCheckReason = new javax.swing.JLabel();
        bGenerate = new javax.swing.JButton();
        bHelp = new javax.swing.JButton();

        setBackground(new java.awt.Color(255, 255, 255));

        lbClose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/close_20.png"))); // NOI18N
        lbClose.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                lbCloseMouseReleased(evt);
            }
        });

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(""), "Generate Shift Request", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Agency FB", 1, 14))); // NOI18N

        jLabel1.setText("Create Date:");

        lbCreateDate.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lbCreateDate.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);

        jLabel3.setText("Request choise:");

        rbDay.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(rbDay);
        rbDay.setSelected(true);
        rbDay.setText("one day");
        rbDay.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbDayActionPerformed(evt);
            }
        });

        rbWeek.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(rbWeek);
        rbWeek.setText("one week");
        rbWeek.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbWeekActionPerformed(evt);
            }
        });

        lbSelectDay.setText("Request Date:");

        lbSelectWeek.setForeground(new java.awt.Color(102, 102, 102));
        lbSelectWeek.setText("Start day of week:");

        dCWeek.setEnabled(false);

        lbMess1.setText("(before one day)");

        lbMess2.setText("(before one week)");

        jLabel8.setText("Choise Shift:");

        cbShifts.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel9.setText("Reason:");

        txaReason.setColumns(20);
        txaReason.setRows(5);
        jScrollPane1.setViewportView(txaReason);

        lbCheckShift.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        lbCheckDate1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        lbCheckDate2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        lbCheck.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lbCheck.setForeground(new java.awt.Color(0, 0, 255));
        lbCheck.setText("check...");
        lbCheck.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbCheckMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbCheckMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbCheckMouseExited(evt);
            }
        });

        lbValid.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        lbCheckReason.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(33, 33, 33)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(rbDay)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(rbWeek))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lbSelectDay)
                                    .addComponent(lbSelectWeek)
                                    .addComponent(jLabel8))
                                .addGap(48, 48, 48)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(cbShifts, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(dCWeek, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(dCDay, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(lbMess2)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(lbCheckDate2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(lbMess1)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(lbCheckDate1, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(lbCheckShift, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 640, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(lbCheckReason, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 297, Short.MAX_VALUE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addComponent(lbCheck)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lbValid, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(lbCreateDate, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(rbDay)
                            .addComponent(rbWeek))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lbSelectDay)
                            .addComponent(dCDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lbMess1)
                        .addComponent(lbCheckDate1)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lbSelectWeek)
                    .addComponent(dCWeek, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lbMess2)
                        .addComponent(lbCheckDate2)))
                .addGap(8, 8, 8)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel8)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cbShifts, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lbCheckShift)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbCreateDate)
                    .addComponent(lbCheckReason)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbValid)
                    .addComponent(lbCheck))
                .addContainerGap())
        );

        bGenerate.setText("Generate");
        bGenerate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bGenerateActionPerformed(evt);
            }
        });

        bHelp.setText("Help");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(bHelp, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 469, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lbClose)
                            .addComponent(bGenerate, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbClose)
                .addGap(8, 8, 8)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bHelp)
                    .addComponent(bGenerate))
                .addContainerGap(26, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

private void lbCloseMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCloseMouseReleased
    close();
}//GEN-LAST:event_lbCloseMouseReleased

private void rbDayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbDayActionPerformed
    switchRequest();
}//GEN-LAST:event_rbDayActionPerformed

private void rbWeekActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbWeekActionPerformed
    switchRequest();
}//GEN-LAST:event_rbWeekActionPerformed

private void bGenerateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bGenerateActionPerformed
    createRequest();
}//GEN-LAST:event_bGenerateActionPerformed

private void lbCheckMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCheckMouseClicked
    checkAction();
}//GEN-LAST:event_lbCheckMouseClicked

private void lbCheckMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCheckMouseEntered
    lbCheck.setForeground(Color.red);
}//GEN-LAST:event_lbCheckMouseEntered

private void lbCheckMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCheckMouseExited
    lbCheck.setForeground(Color.blue);
}//GEN-LAST:event_lbCheckMouseExited
    private RemedySchedulerFrame mainFrame;
    private EditShiftRequestPanel parentPanel;
    private ViewShiftComboBoxModel model;
    private Date createDate;
    private boolean choiseDay;
    private boolean check1, check2, check3, check4;
    private boolean valid;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bGenerate;
    private javax.swing.JButton bHelp;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JComboBox cbShifts;
    private com.toedter.calendar.JDateChooser dCDay;
    private com.toedter.calendar.JDateChooser dCWeek;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lbCheck;
    private javax.swing.JLabel lbCheckDate1;
    private javax.swing.JLabel lbCheckDate2;
    private javax.swing.JLabel lbCheckReason;
    private javax.swing.JLabel lbCheckShift;
    private javax.swing.JLabel lbClose;
    private javax.swing.JLabel lbCreateDate;
    private javax.swing.JLabel lbMess1;
    private javax.swing.JLabel lbMess2;
    private javax.swing.JLabel lbSelectDay;
    private javax.swing.JLabel lbSelectWeek;
    private javax.swing.JLabel lbValid;
    private javax.swing.JRadioButton rbDay;
    private javax.swing.JRadioButton rbWeek;
    private javax.swing.JTextArea txaReason;
    // End of variables declaration//GEN-END:variables
}
